<template>
	<view>
		<!-- 广告图 -->
		<banner :inset='con'></banner>
		<!-- <view class="sizheng" v-if="cokei =='2'"> -->
		<view class="sizheng">
			<text class="btwz">课程分类</text>
			<view class="sizh">
				<view class="sz_zt" v-for="(item,index) in conte" @click="sizheng(item.id)" :key="index">
					<view class="sz_t">
						<image :src="item.faceUrl" mode="heightFix"></image>
					</view>
					<text class="wenzi">{{item.name}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			var con = '/static/banner/jx.png'
			return{
				con:con,
				conte:[],
				kecon:[],
				jy:[],
				cokei:'',
				id:'',
				showMovie:false,
			}
		},
		onLoad(options) {
			console.log('options',options)
		},
		created() {
			this.cokei = uni.getStorageSync('cokei')
			let that = this
			let params = {
				typeId: this.id,
			  pageNo:1,
			  pageSize:99999
			}
			this.getClazzType()
		},
		methods:{
			getClazzType() { //获取课程分类
				let that = this;
				that.pyReq(that.$http.getClazzType,{},function(res){
						  console.log('获取课程分类res', res)
						  that.conte = res.result;
				});
			},
			sizheng(id){
				console.log(id)
				uni.navigateTo({
					url:'./jiaoxuetype?showMovie=1?id=' + id
				})
			},
		}
	}
</script>

<style>
	.sizheng{
		margin-top: 20upx;
	}
	.btwz{
		font-size: 30upx;
		margin-left: 43upx;
	}
	.sizh{
		display: flex;
		flex-wrap: wrap;
		
		padding: 0 23upx;
	}
	.zybos{
		display: flex;
		flex-wrap: wrap;
		padding: 0 40upx;
		justify-content: space-between;
	}
	.zy{
		width: 320upx;
		/* margin: 20upx 20upx; */
		display: inline-block;
	}
	.zy text{
		font-size: 28upx;
		font-weight: 700;
		padding-left: 20upx;
		padding-top: 30upx;
		padding-bottom: 30upx;
		display: block;
	}
	.zy_t{
		width: 320upx;
		height: 160upx;
		border-radius: 10upx;
		overflow: hidden;
	}
	.sz_t{
		width: 221upx;
		height: 147upx;
		border-radius: 10upx;
		overflow: hidden;
	}
	.sz_t>image{
		display: block;
		height: 147upx;
		margin: 0 auto;
	}
	.sz_zt{
		width: 221upx;
		margin: 20upx 6upx;
	}
		.wenzi{
			display: block;
			text-align: center;
			font-size: 26upx;
			margin-top: 16upx;
			overflow: hidden;
			text-overflow:ellipsis;
			white-space: nowrap;
		}
</style>